import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

const routes=[
    {
        path:"/",
        component:()=>import("@/views/homePage.vue"),
        redirect:"/pRank",
        children:[
            {
                path:"pRank",
                name:"pRank",
                component:()=>import("@/views/pRank/index.vue")
            },
            {
                path:"onePosition",
                name:"onePosition",
                component:()=>import("@/views/onePosition/index.vue")
            }
        ]
    },
    {
        path:"/noAuthentification",
        name:"noAuthentification",
        component:()=>import("@/views/noAuthentification.vue")
    },
    {
        path:"*",
        component:()=>import("@/views/404.vue")
    }
];

// console.log(process.env.BASE_URL);
const router=new VueRouter({
    mode:"history",
    base:process.env.BASE_URL,
    routes
});

export default router;
